// vim:ft=javascript

ARG_WITH("xdebug", "Xdebug support", "no");

if (PHP_XDEBUG != 'no') {
	var XDEBUG_BASE_SOURCES="base.c filter.c monitor.c stack.c superglobals.c"
	var XDEBUG_LIB_SOURCES="usefulstuff.c compat.c crc32.c hash.c lib.c llist.c set.c str.c var.c var_export_html.c var_export_line.c var_export_serialized.c var_export_text.c var_export_xml.c xml.c"

	var XDEBUG_COVERAGE_SOURCES="branch_info.c code_coverage.c"
	var XDEBUG_DEBUGGER_SOURCES="com.c debugger.c handler_dbgp.c handlers.c"
	var XDEBUG_GCSTATS_SOURCES="gc_stats.c"
	var XDEBUG_PROFILER_SOURCES="profiler.c"
	var XDEBUG_TRACING_SOURCES="trace_computerized.c trace_html.c trace_textual.c tracing.c"
	
	var files = "xdebug.c";

	if (typeof(ZEND_EXTENSION) == 'undefined') {
		EXTENSION('xdebug', files);
	} else {
		ZEND_EXTENSION('xdebug', files);
	}
	ADD_FLAG("CFLAGS_XDEBUG", " /I " + configure_module_dirname + " ");
	ADD_FLAG("CFLAGS_XDEBUG", " /I " + configure_module_dirname + "/src ");
	ADD_SOURCES(configure_module_dirname + "/src/base", XDEBUG_BASE_SOURCES, "xdebug");
	ADD_SOURCES(configure_module_dirname + "/src/lib", XDEBUG_LIB_SOURCES, "xdebug");
	ADD_SOURCES(configure_module_dirname + "/src/coverage", XDEBUG_COVERAGE_SOURCES, "xdebug");
	ADD_SOURCES(configure_module_dirname + "/src/debugger", XDEBUG_DEBUGGER_SOURCES, "xdebug");
	ADD_SOURCES(configure_module_dirname + "/src/gcstats", XDEBUG_GCSTATS_SOURCES, "xdebug");
	ADD_SOURCES(configure_module_dirname + "/src/profiler", XDEBUG_PROFILER_SOURCES, "xdebug");
	ADD_SOURCES(configure_module_dirname + "/src/tracing", XDEBUG_TRACING_SOURCES, "xdebug");

	AC_DEFINE("HAVE_XDEBUG", 1, "Xdebug support");
}
